/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.hotel.test.model.impl;

import com.hotel.test.model.Booking;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing Booking in entity cache.
 *
 * @author Vien-IT
 * @see Booking
 * @generated
 */
public class BookingCacheModel implements CacheModel<Booking>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(31);

		sb.append("{bookId=");
		sb.append(bookId);
		sb.append(", userId=");
		sb.append(userId);
		sb.append(", userName=");
		sb.append(userName);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", modifiedDate=");
		sb.append(modifiedDate);
		sb.append(", namePersonBooking=");
		sb.append(namePersonBooking);
		sb.append(", numberPhone=");
		sb.append(numberPhone);
		sb.append(", emailBooking=");
		sb.append(emailBooking);
		sb.append(", address=");
		sb.append(address);
		sb.append(", numberOfGuest=");
		sb.append(numberOfGuest);
		sb.append(", otherRequest=");
		sb.append(otherRequest);
		sb.append(", dayStart=");
		sb.append(dayStart);
		sb.append(", dayFinish=");
		sb.append(dayFinish);
		sb.append(", hotelId=");
		sb.append(hotelId);
		sb.append(", romId=");
		sb.append(romId);
		sb.append("}");

		return sb.toString();
	}

	public Booking toEntityModel() {
		BookingImpl bookingImpl = new BookingImpl();

		bookingImpl.setBookId(bookId);
		bookingImpl.setUserId(userId);

		if (userName == null) {
			bookingImpl.setUserName(StringPool.BLANK);
		}
		else {
			bookingImpl.setUserName(userName);
		}

		if (createDate == Long.MIN_VALUE) {
			bookingImpl.setCreateDate(null);
		}
		else {
			bookingImpl.setCreateDate(new Date(createDate));
		}

		if (modifiedDate == Long.MIN_VALUE) {
			bookingImpl.setModifiedDate(null);
		}
		else {
			bookingImpl.setModifiedDate(new Date(modifiedDate));
		}

		if (namePersonBooking == null) {
			bookingImpl.setNamePersonBooking(StringPool.BLANK);
		}
		else {
			bookingImpl.setNamePersonBooking(namePersonBooking);
		}

		if (numberPhone == null) {
			bookingImpl.setNumberPhone(StringPool.BLANK);
		}
		else {
			bookingImpl.setNumberPhone(numberPhone);
		}

		if (emailBooking == null) {
			bookingImpl.setEmailBooking(StringPool.BLANK);
		}
		else {
			bookingImpl.setEmailBooking(emailBooking);
		}

		if (address == null) {
			bookingImpl.setAddress(StringPool.BLANK);
		}
		else {
			bookingImpl.setAddress(address);
		}

		bookingImpl.setNumberOfGuest(numberOfGuest);

		if (otherRequest == null) {
			bookingImpl.setOtherRequest(StringPool.BLANK);
		}
		else {
			bookingImpl.setOtherRequest(otherRequest);
		}

		if (dayStart == null) {
			bookingImpl.setDayStart(StringPool.BLANK);
		}
		else {
			bookingImpl.setDayStart(dayStart);
		}

		if (dayFinish == null) {
			bookingImpl.setDayFinish(StringPool.BLANK);
		}
		else {
			bookingImpl.setDayFinish(dayFinish);
		}

		bookingImpl.setHotelId(hotelId);
		bookingImpl.setRomId(romId);

		bookingImpl.resetOriginalValues();

		return bookingImpl;
	}

	public long bookId;
	public long userId;
	public String userName;
	public long createDate;
	public long modifiedDate;
	public String namePersonBooking;
	public String numberPhone;
	public String emailBooking;
	public String address;
	public int numberOfGuest;
	public String otherRequest;
	public String dayStart;
	public String dayFinish;
	public long hotelId;
	public long romId;
}